<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
 <%@page import="sdfi.lee.Entity.Enterprise"%>
<%@page import="sdfi.lee.DAO.EnterpriseDAO"%>
<%@page import="java.util.List"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="location" content="<a href='<c:url value='/enterprise/eplist.jsp?pg=1&etype=${param.etype}' />'>
<c:if test="${param.etype==1}">骨干企业</c:if>
			<c:if test="${param.etype==2}">参建单位</c:if>
			<c:if test="${param.etype==3}">区内企业</c:if>
			<c:if test="${param.etype==4}">全国十五大平台</c:if></a>">
<link rel="stylesheet" href="../css/index.css" />
<link rel="stylesheet" href="../css/level.css" />
<script type="text/javascript" src="../js/jquery-1.6.js" ></script>
<script type="text/javascript" src="../js/index.js"></script>
<script type="text/javascript">
</script>
<title></title>
</head>
<body>
<%
Integer etype=Integer.valueOf(request.getParameter("etype"));

List<Enterprise> list=null;
if(etype.intValue()==3)
list=new EnterpriseDAO().getAllEnterprise(etype,Integer.valueOf(request.getParameter("pg")),20);
else list=new EnterpriseDAO().getAllEnterprise(etype,Integer.valueOf(request.getParameter("pg")),20);
request.setAttribute("list",list);
%>
<c:choose>
				<c:when test="${param.etype!=3}">
			<c:forEach items="${requestScope.list}" var="ep" varStatus="status">
				<div class="epitem">
					<c:url value="/enterprise/epdetail.jsp" var="epath">
						<c:param name="eid" value="${ep.id}"></c:param>
						<c:param name="etype" value="${param.etype}"></c:param>
						<c:param name="pg" value="${param.pg}"></c:param>
					</c:url>
			<table width="100%">
				<tr>
					<td style="width:20%;text-align:left;">
						<a href="${epath }"><img src="<c:url value='${ep.eppath}' />" ></a>
					</td>
					<td>
						<a href="${epath}">${ep.epname}</a>
					</td>
				</tr>
			</table>
			</div>
			</c:forEach>
			</c:when>
			<c:otherwise>
				<c:forEach items="${requestScope.list}" var="ep">
				<div class="epitem">
					<c:url value="/enterprise/epdetail.jsp" var="epath">
						<c:param name="eid" value="${ep.id}"></c:param>
						<c:param name="etype" value="${param.etype}"></c:param>
						<c:param name="pg" value="${param.pg}"></c:param>
					</c:url>
				
					<a href="${epath}">${ep.epname}</a>
				</div>
				
			</c:forEach>
			</c:otherwise>
			</c:choose>
			<div style="clear:left;"></div>
   <div id="pages">
                	
                	         	
                每页<span>20</span>条,第<span>${param.pg}</span>页,该页
                	<span>${fn:length(requestScope.list) }</span>条
                    <c:choose>
                		<c:when test='${param.pg==null||param.pg==""||param.pg==1}'>
                			上页
                		</c:when>
                		<c:otherwise>
                			<c:url value='/enterprise/eplist.jsp?etype=${param.etype}&pg=${param.pg-1}'  var="down"/>
                			 <a href="${down}">上页</a>
                		</c:otherwise>
                	</c:choose>
                	
                   	<c:choose>
                   		<c:when test="${fn:length(requestScope.list)<20}">
                   			下页
                   		</c:when>
                   		<c:otherwise>
                   		<a href="<c:url value='/enterprise/eplist.jsp?etype=${param.etype}&pg=${param.pg+1}' />">下页</a>
                   		</c:otherwise>
                   	</c:choose>
                    
                </div>

</body>


</html>